home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / OPTION.C < prev    next >
C/C++ Source or Header  |  1992-06-05  |  36KB  |  1,267 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/src/microcode/RCS/option.c,v 1.24 1992/06/05 04:38:41 jinx Exp $
  4.  
  5. Copyright (c) 1990-92 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* Command-line option processing */
  36.  
  37. #include <stdio.h>
  38. #include <ctype.h>
  39. #include <sys/types.h>
  40. #include <sys/stat.h>
  41. #include "ansidecl.h"
  42. #include "obstack.h"
  43. #include "osenv.h"
  44.  
  45. extern char * getenv ();
  46. extern void free ();
  47. #define xfree(p) free ((PTR) (p))
  48. extern int strlen ();
  49. extern int atoi ();
  50. extern int access ();
  51. extern struct obstack scratch_obstack;
  52. extern CONST char * scheme_program_name;
  53. extern void EXFUN (termination_init_error, (void));
  54.  
  55. #ifndef SUB_DIRECTORY_DELIMITER
  56. #  ifdef DOS386
  57. #    define SUB_DIRECTORY_DELIMITER '\\'
  58. #  else
  59. #    define SUB_DIRECTORY_DELIMITER '/'
  60. #  endif
  61. #endif
  62.  
  63. #ifndef PATH_DELIMITER
  64. #  ifdef DOS386
  65. #    define PATH_DELIMITER ';'
  66. #  else
  67. #    define PATH_DELIMITER ':'
  68. #  endif
  69. #endif
  70.  
  71. #ifdef DOS386
  72. #  define FILE_ABSOLUTE(filename)            \
  73.      ((((filename) [0]) == SUB_DIRECTORY_DELIMITER)    \
  74.       || (((filename) [1]) == ':'))
  75. #else
  76. #  define FILE_ABSOLUTE(filename) (((filename) [0]) == SUB_DIRECTORY_DELIMITER)
  77. #endif
  78.  
  79. #define FILE_READABLE(filename) ((access ((filename), 4)) >= 0)
  80.  
  81. static int option_summary;
  82. static int option_large_sizes;
  83.  
  84. #ifdef HAS_COMPILER_SUPPORT
  85. static int option_compiler_defaults;
  86. static int option_edwin_defaults;
  87. #endif
  88.  
  89. static CONST char * option_raw_library = 0;
  90. static CONST char * option_raw_utabmd = 0;
  91. static CONST char * option_raw_utab = 0;
  92. static CONST char * option_raw_band = 0;
  93. static CONST char * option_raw_heap = 0;
  94. static CONST char * option_raw_constant = 0;
  95. static CONST char * option_raw_stack = 0;
  96.  
  97. /* Command-line arguments */
  98. int option_saved_argc;
  99. CONST char ** option_saved_argv;
  100. int option_unused_argc;
  101. CONST char ** option_unused_argv;
  102.  
  103. /* Boolean options */
  104. int option_emacs_subprocess;
  105. int option_force_interactive;
  106. int option_disable_core_dump;
  107. int option_band_specified;
  108.  
  109. /* String options */
  110. CONST char ** option_library_path = 0;
  111. CONST char * option_band_file = 0;
  112. CONST char * option_fasl_file = 0;
  113. CONST char * option_utabmd_file = 0;
  114.  
  115. /* Numeric options */
  116. unsigned int option_heap_size;
  117. unsigned int option_constant_size;
  118. unsigned int option_stack_size;
  119.  
  120. /* These only matter for bchscheme */
  121. static CONST char * option_raw_gc_end_position = 0;
  122. static CONST char * option_raw_gc_file = 0;
  123. static CONST char * option_raw_gc_read_overlap = 0;
  124. static CONST char * option_raw_gc_start_position = 0;
  125. static CONST char * option_raw_gc_window_size = 0;
  126. static CONST char * option_raw_gc_write_overlap = 0;
  127. CONST char * option_gc_directory = 0;
  128. CONST char * option_gc_drone = 0;
  129. CONST char * option_gc_file = 0;
  130. int option_gc_keep;
  131. int option_gc_read_overlap;
  132. int option_gc_window_size;
  133. int option_gc_write_overlap;
  134. long option_gc_start_position;
  135. long option_gc_end_position;
  136. /*
  137. Scheme accepts the following command-line options.  The options may
  138. appear in any order, but they must all appear before any other
  139. arguments on the command line.
  140.  
  141. -library PATH
  142.   Sets the library search path to PATH.  This is a colon-separated
  143.   list of directories that is searched to find various library files,
  144.   such as bands.  If this option is not given, the value of the
  145.   environment variable MITSCHEME_LIBRARY_PATH is used; it that isn't
  146.   defined, "/usr/local/lib/mit-scheme" is used.
  147.  
  148. -band FILENAME
  149.   Specifies the initial band to be loaded.  Searches for FILENAME in
  150.   the working directory and the library directories, returning the
  151.   full pathname of the first readable file of that name.  If this
  152.   option isn't given, the filename is the value of the environment
  153.   variable MITSCHEME_BAND, or if that isn't defined, "runtime.com"; in
  154.   these cases the library directories are searched, but not the
  155.   working directory.
  156.  
  157. -fasl FILENAME
  158.   Specifies that a cold load should be performed, using FILENAME as
  159.   the initial file to be loaded.  If this option isn't given, a normal
  160.   load is performed instead.  This option may not be used together
  161.   with the "-band" option.
  162.  
  163. -utabmd FILENAME
  164.   Specifies the name of the microcode tables file.  The file is
  165.   searched for in the working directory and the library directories.
  166.   If this option isn't given, the filename is the value of the
  167.   environment variable MITSCHEME_UTABMD_FILE, or if that isn't
  168.   defined, "utabmd.bin"; in these cases the library directories are
  169.   searched, but not the working directory.
  170.  
  171. -utab FILENAME
  172.   An alternate name for the "-utabmd" option.  At most one of these
  173.   options may be given.
  174.  
  175. -large
  176.   Specifies that large heap, constant, and stack default sizes should
  177.   be used.  These are specified by the environment variables
  178.   MITSCHEME_LARGE_HEAP, MITSCHEME_LARGE_CONSTANT, and
  179.   MITSCHEME_LARGE_STACK.  If this option isn't given, the small sizes
  180.   are used, specified by the environment variables
  181.   MITSCHEME_SMALL_HEAP, MITSCHEME_SMALL_CONSTANT, and
  182.   MITSCHEME_SMALL_STACK.  There are reasonable built-in defaults for
  183.   these environment variables, should any of them be undefined.  [The
  184.   Scheme procedure `(print-gc-statistics)' shows how much heap and
  185.   constant space is available and in use.]
  186.  
  187. -heap BLOCKS
  188.   Specifies the size of the heap in 1024-word blocks.  Overrides any
  189.   default.  Normally two such heaps are allocated; `bchscheme'
  190.   allocates only one.
  191.  
  192. -constant BLOCKS
  193.   Specifies the size of constant space in 1024-word blocks.  Overrides
  194.   any default.
  195.  
  196. -stack BLOCKS
  197.   Specifies the size of the stack in 1024-word blocks.  Overrides any
  198.   default.
  199.  
  200. -option-summary
  201.   Causes Scheme to write option information to standard error.
  202.  
  203. -emacs
  204.   Specifies that Scheme is running as a subprocess of GNU Emacs.
  205.   This option is automatically supplied by GNU Emacs, and should not
  206.   be given under other circumstances.
  207.  
  208. -interactive
  209.   If this option isn't specified, and Scheme's standard I/O is not a
  210.   terminal, Scheme will detach itself from its controlling terminal.
  211.   This will prevent it from getting signals sent to the process group
  212.   of that terminal.  If this option is specified, Scheme will not
  213.   detach itself from the controlling terminal.
  214.  
  215. -nocore
  216.   Specifies that Scheme should not generate a core dump under any
  217.   circumstances.
  218.  
  219. The following options are available only on machines with
  220. compiled-code support:
  221.  
  222. -compiler
  223.   This option specifies defaults appropriate for loading the compiler.
  224.   It changes the defaults for "-band": the environment variable
  225.   MITSCHEME_COMPILER_BAND is used, otherwise "compiler.com" is used.
  226.   It also specifies the use of large sizes, exactly like "-large".
  227.  
  228. -edwin
  229.   This option specifies defaults appropriate for loading the editor.
  230.   It changes the defaults for "-band": the environment variable
  231.   MITSCHEME_EDWIN_BAND is used, otherwise "edwin.com" is used.  It
  232.   also specifies the use of large sizes, exactly like "-large".
  233.  
  234. The following options are only meaningful to bchscheme:
  235.  
  236. -gc-directory DIRECTORY
  237.   Specifies what directory to use to allocate the garbage collection file.
  238.  
  239. -gc-drone FILENAME
  240.   Specifies the program to use as the gc drones for overlapped I/O.
  241.  
  242. -gc-end-position N
  243.   Specifies a position into the gc file past which bchscheme should not use. 
  244.  
  245. -gc-file FILENAME
  246.   Specifies that FILENAME should be used garbage collection.  Overrides
  247.   -gc-directory if it is an absolute pathname.  -gcfile means the same thing,
  248.   but is deprecated.
  249.  
  250. -gc-keep
  251.   Specifles that newly allocated gc files should be kept rather than deleted.
  252.  
  253. -gc-read-overlap N
  254.   Specifies the number of additional GC windows to use when reading
  255.   for overlapped I/O.  Each implies a drone process to manage it,
  256.   if supported.
  257.  
  258. -gc-start-position N
  259.   Specifies a position into the gc file before which bchscheme should not use.
  260.  
  261. -gc-window-size BLOCKS
  262.   Specifies the size in 1024-word blocks of each GC window.
  263.  
  264. -gc-write-overlap N
  265.   Specifies the number of additional GC windows to use when writing for
  266.   overlapped I/O.  Each implies a drone process to manage it, if supported.
  267. */
  268.  
  269. #ifndef LIBRARY_PATH_VARIABLE
  270. #define LIBRARY_PATH_VARIABLE "MITSCHEME_LIBRARY_PATH"
  271. #endif
  272.  
  273. #ifndef DEFAULT_LIBRARY_PATH
  274. #ifdef DOS386
  275. #define DEFAULT_LIBRARY_PATH "\\scheme\\lib"
  276. #else
  277. #define DEFAULT_LIBRARY_PATH "/usr/local/lib/mit-scheme"
  278. #endif
  279. #endif
  280.  
  281. #ifndef BAND_VARIABLE
  282. #define BAND_VARIABLE "MITSCHEME_BAND"
  283. #endif
  284.  
  285. #ifndef DEFAULT_BAND
  286. #define DEFAULT_BAND "runtime.com"
  287. #endif
  288.  
  289. #ifndef COMPILER_BAND_VARIABLE
  290. #define COMPILER_BAND_VARIABLE "MITSCHEME_COMPILER_BAND"
  291. #endif
  292.  
  293. #ifndef COMPILER_DEFAULT_BAND
  294. #define COMPILER_DEFAULT_BAND "compiler.com"
  295. #endif
  296.  
  297. #ifndef EDWIN_BAND_VARIABLE
  298. #define EDWIN_BAND_VARIABLE "MITSCHEME_EDWIN_BAND"
  299. #endif
  300.  
  301. #ifndef EDWIN_DEFAULT_BAND
  302. #define EDWIN_DEFAULT_BAND "edwin.com"
  303. #endif
  304.  
  305. #ifndef UTABMD_FILE_VARIABLE
  306. #define UTABMD_FILE_VARIABLE "MITSCHEME_UTABMD_FILE"
  307. #endif
  308.  
  309. #ifndef DEFAULT_UTABMD_FILE
  310. #define DEFAULT_UTABMD_FILE "utabmd.bin"
  311. #endif
  312.  
  313. #ifdef HAS_COMPILER_SUPPORT
  314.  
  315. #ifdef hp9000s800
  316. /* HPPA compiled binaries are large! */
  317.  
  318. #ifndef DEFAULT_SMALL_CONSTANT
  319. #define DEFAULT_SMALL_CONSTANT 600
  320. #endif
  321.  
  322. #ifndef DEFAULT_LARGE_CONSTANT
  323. #define DEFAULT_LARGE_CONSTANT 1300
  324. #endif
  325.  
  326. #endif /* hp9000s800 */
  327.  
  328. #ifdef mips
  329. /* MIPS compiled binaries are large! */
  330.  
  331. #ifndef DEFAULT_SMALL_CONSTANT
  332. #define DEFAULT_SMALL_CONSTANT 700
  333. #endif
  334.  
  335. #ifndef DEFAULT_LARGE_CONSTANT
  336. #define DEFAULT_LARGE_CONSTANT 1500
  337. #endif
  338.  
  339. #endif /* mips */
  340.  
  341. #ifdef i386
  342. /* 386 code is large too! */
  343.  
  344. #ifndef DEFAULT_SMALL_CONSTANT
  345. #define DEFAULT_SMALL_CONSTANT 430
  346. #endif
  347.  
  348. #ifndef DEFAULT_LARGE_CONSTANT
  349. #define DEFAULT_LARGE_CONSTANT 1010
  350. #endif
  351.  
  352. #ifndef DEFAULT_EDWIN_CONSTANT
  353. #define DEFAULT_EDWIN_CONSTANT 850
  354. #endif
  355.  
  356. #endif /* i386 */
  357.  
  358. #endif /* HAS_COMPILER_SUPPORT */
  359.  
  360. #ifndef DEFAULT_SMALL_HEAP
  361. #define DEFAULT_SMALL_HEAP 250
  362. #endif
  363.  
  364. #ifndef SMALL_HEAP_VARIABLE
  365. #define SMALL_HEAP_VARIABLE "MITSCHEME_SMALL_HEAP"
  366. #endif
  367.  
  368. #ifndef DEFAULT_SMALL_CONSTANT
  369. #define DEFAULT_SMALL_CONSTANT 400
  370. #endif
  371.  
  372. #ifndef SMALL_CONSTANT_VARIABLE
  373. #define SMALL_CONSTANT_VARIABLE "MITSCHEME_SMALL_CONSTANT"
  374. #endif
  375.  
  376. #ifndef DEFAULT_SMALL_STACK
  377. #define    DEFAULT_SMALL_STACK 100
  378. #endif
  379.  
  380. #ifndef SMALL_STACK_VARIABLE
  381. #define SMALL_STACK_VARIABLE "MITSCHEME_SMALL_STACK"
  382. #endif
  383.  
  384. #ifndef DEFAULT_LARGE_HEAP
  385. #define DEFAULT_LARGE_HEAP 1000
  386. #endif
  387.  
  388. #ifndef LARGE_HEAP_VARIABLE
  389. #define LARGE_HEAP_VARIABLE "MITSCHEME_LARGE_HEAP"
  390. #endif
  391.  
  392. #ifndef DEFAULT_LARGE_CONSTANT
  393. #define DEFAULT_LARGE_CONSTANT 1000
  394. #endif
  395.  
  396. #ifndef DEFAULT_EDWIN_CONSTANT
  397. #define DEFAULT_EDWIN_CONSTANT DEFAULT_LARGE_CONSTANT
  398. #endif
  399.  
  400. #ifndef LARGE_CONSTANT_VARIABLE
  401. #define LARGE_CONSTANT_VARIABLE "MITSCHEME_LARGE_CONSTANT"
  402. #endif
  403.  
  404. #ifndef DEFAULT_LARGE_STACK
  405. #define DEFAULT_LARGE_STACK DEFAULT_SMALL_STACK
  406. #endif
  407.  
  408. #ifndef LARGE_STACK_VARIABLE
  409. #define LARGE_STACK_VARIABLE "MITSCHEME_LARGE_STACK"
  410. #endif
  411.  
  412. /* These are only meaningful for bchscheme */
  413.  
  414. #ifndef DEFAULT_GC_DIRECTORY
  415. #ifdef DOS386
  416. #define DEFAULT_GC_DIRECTORY        "\\tmp"
  417. #else
  418. #define DEFAULT_GC_DIRECTORY        "/tmp"
  419. #endif
  420. #endif
  421.  
  422. #ifndef GC_DIRECTORY_VARIABLE
  423. #define GC_DIRECTORY_VARIABLE        "MITSCHEME_GC_DIRECTORY"
  424. #endif
  425.  
  426. #ifndef DEFAULT_GC_DRONE
  427. #define DEFAULT_GC_DRONE        "gcdrone"
  428. #endif
  429.  
  430. #ifndef GC_DRONE_VARIABLE
  431. #define GC_DRONE_VARIABLE        "MITSCHEME_GC_DRONE"
  432. #endif
  433.  
  434. #ifndef DEFAULT_GC_END_POSITION
  435. #define DEFAULT_GC_END_POSITION        -1
  436. #endif
  437.  
  438. #ifndef GC_END_POSITION_VARIABLE
  439. #define GC_END_POSITION_VARIABLE    "MITSCHEME_GC_END_POSITION"
  440. #endif
  441.  
  442. #ifndef DEFAULT_GC_FILE
  443. #define DEFAULT_GC_FILE            "GCXXXXXX"
  444. #endif
  445.  
  446. #ifndef GC_FILE_VARIABLE
  447. #define GC_FILE_VARIABLE        "MITSCHEME_GC_FILE"
  448. #endif
  449.  
  450. #ifndef DEFAULT_GC_READ_OVERLAP
  451. #define DEFAULT_GC_READ_OVERLAP        0
  452. #endif
  453.  
  454. #ifndef GC_READ_OVERLAP_VARIABLE
  455. #define GC_READ_OVERLAP_VARIABLE    "MITSCHEME_GC_READ_OVERLAP"
  456. #endif
  457.  
  458. #ifndef DEFAULT_GC_START_POSITION
  459. #define DEFAULT_GC_START_POSITION    0
  460. #endif
  461.  
  462. #ifndef GC_START_POSITION_VARIABLE
  463. #define GC_START_POSITION_VARIABLE    "MITSCHEME_GC_START_POSITION"
  464. #endif
  465.  
  466. #ifndef DEFAULT_GC_WINDOW_SIZE
  467. #define DEFAULT_GC_WINDOW_SIZE        16
  468. #endif
  469.  
  470. #ifndef GC_WINDOW_SIZE_VARIABLE
  471. #define GC_WINDOW_SIZE_VARIABLE        "MITSCHEME_GC_WINDOW_SIZE"
  472. #endif
  473.  
  474. #ifndef DEFAULT_GC_WRITE_OVERLAP
  475. #define DEFAULT_GC_WRITE_OVERLAP    0
  476. #endif
  477.  
  478. #ifndef GC_WRITE_OVERLAP_VARIABLE
  479. #define GC_WRITE_OVERLAP_VARIABLE    "MITSCHEME_GC_WRITE_OVERLAP"
  480. #endif
  481.  
  482. static int
  483. DEFUN (string_compare_ci, (string1, string2),
  484.        CONST char * string1 AND
  485.        CONST char * string2)
  486. {
  487.   CONST char * scan1 = string1;
  488.   unsigned int length1 = (strlen (string1));
  489.   CONST char * scan2 = string2;
  490.   unsigned int length2 = (strlen (string2));
  491.   unsigned int length = ((length1 < length2) ? length1 : length2);
  492.   CONST char * end1 = (scan1 + length);
  493.   CONST char * end2 = (scan2 + length);
  494.   while ((scan1 < end1) && (scan2 < end2))
  495.     {
  496.       int c1 = (*scan1++);
  497.       int c2 = (*scan2++);
  498.       if (islower (c1))
  499.     {
  500.       if (! (islower (c2)))
  501.         c1 = (toupper (c1));
  502.     }
  503.       else
  504.     {
  505.       if (islower (c2))
  506.         c2 = (toupper (c2));
  507.     }
  508.       if (c1 != c2)
  509.     return ((c1 < c2) ? (-1) : 1);
  510.     }
  511.   return
  512.     ((length1 == length2)
  513.      ? 0
  514.      : ((length1 < length2) ? (-1) : 1));
  515. }
  516.  
  517. static char *
  518. DEFUN (strchr, (s, c), CONST char * s AND int c)
  519. {
  520.   while (1)
  521.     {
  522.       int c1 = (*s++);
  523.       if (c1 == c) return ((char *) (s - 1));
  524.       if (c1 == '\0') return (0);
  525.     }
  526. }
  527.  
  528. static PTR
  529. DEFUN (xmalloc, (n), unsigned long n)
  530. {
  531.   extern char * malloc ();
  532.   PTR result = (malloc (n));
  533.   if (result == 0)
  534.     {
  535.       fprintf (stderr, "%s: unable to allocate space while parsing options.\n",
  536.            scheme_program_name);
  537.       termination_init_error ();
  538.     }
  539.   return (result);
  540. }
  541.  
  542. static char *
  543. DEFUN (string_copy, (s), CONST char * s)
  544. {
  545.   char * result = (xmalloc ((strlen (s)) + 1));
  546.   {
  547.     CONST char * s1 = s;
  548.     char * s2 = result;
  549.     while (((*s2++) = (*s1++)) != '\0') ;
  550.   }
  551.   return (result);
  552. }
  553.  
  554. struct option_descriptor
  555. {
  556.   CONST char * option;
  557.   int argument_p;
  558.   PTR value_cell;
  559. };
  560.  
  561. static void
  562. DEFUN (option_argument, (option, argument_p, value_cell),
  563.        CONST char * option AND
  564.        int argument_p AND
  565.        PTR value_cell)
  566. {
  567.   struct option_descriptor descriptor;
  568.   (descriptor . option) = option;
  569.   (descriptor . argument_p) = argument_p;
  570.   (descriptor . value_cell) = value_cell;
  571.   obstack_grow ((&scratch_obstack), (&descriptor), (sizeof (descriptor)));
  572. }
  573.  
  574. static void
  575. DEFUN (parse_options, (argc, argv), int argc AND CONST char ** argv)
  576. {
  577.   CONST char ** scan_argv = (argv + 1);
  578.   CONST char ** end_argv = (scan_argv + (argc - 1));
  579.   unsigned int n_descriptors =
  580.     ((obstack_object_size (&scratch_obstack))
  581.      / (sizeof (struct option_descriptor)));
  582.   struct option_descriptor * descriptors = (obstack_finish (&scratch_obstack));
  583.   struct option_descriptor * end_desc = (descriptors + n_descriptors);
  584.   struct option_descriptor * scan_desc;
  585.   for (scan_desc = descriptors; (scan_desc < end_desc); scan_desc += 1)
  586.     if (scan_desc -> argument_p)
  587.       {
  588.     CONST char ** value_cell = (scan_desc -> value_cell);
  589.     (*value_cell) = 0;
  590.       }
  591.     else
  592.       {
  593.     int * value_cell = (scan_desc -> value_cell);
  594.     (*value_cell) = 0;
  595.       }
  596.   while (scan_argv < end_argv)
  597.     {
  598.       CONST char * option = (*scan_argv++);
  599.       for (scan_desc = descriptors; (scan_desc < end_desc); scan_desc += 1)
  600.     if ((string_compare_ci (option, (scan_desc -> option))) == 0)
  601.       {
  602.         if (scan_desc -> argument_p)
  603.           {
  604.         CONST char ** value_cell = (scan_desc -> value_cell);
  605.         if (scan_argv < end_argv)
  606.           (*value_cell) = (*scan_argv++);
  607.         else
  608.           {
  609.             fprintf (stderr, "%s: option %s requires an argument.\n",
  610.                  scheme_program_name, option);
  611.             termination_init_error ();
  612.           }
  613.           }
  614.         else
  615.           {
  616.         int * value_cell = (scan_desc -> value_cell);
  617.         (*value_cell) = 1;
  618.           }
  619.         break;
  620.       }
  621.       if (scan_desc == end_desc)
  622.     {
  623.       scan_argv -= 1;
  624.       break;
  625.     }
  626.     }
  627.   obstack_free ((&scratch_obstack), descriptors);
  628.   option_saved_argc = argc;
  629.   option_saved_argv = argv;
  630.   option_unused_argc = (end_argv - scan_argv);
  631.   option_unused_argv = scan_argv;
  632. }
  633.  
  634. static void
  635. DEFUN (parse_standard_options, (argc, argv), int argc AND CONST char ** argv)
  636. {
  637.   option_argument ("-band", 1, (&option_raw_band));
  638.   option_argument ("-constant", 1, (&option_raw_constant));
  639.   option_argument ("-emacs", 0, (&option_emacs_subprocess));
  640.   option_argument ("-fasl", 1, (&option_fasl_file));
  641.   option_argument ("-heap", 1, (&option_raw_heap));
  642.   option_argument ("-interactive", 0, (&option_force_interactive));
  643.   option_argument ("-large", 0, (&option_large_sizes));
  644.   option_argument ("-library", 1, (&option_raw_library));
  645.   option_argument ("-nocore", 0, (&option_disable_core_dump));
  646.   option_argument ("-option-summary", 0, (&option_summary));
  647.   option_argument ("-stack", 1, (&option_raw_stack));
  648.   option_argument ("-utab", 1, (&option_raw_utab));
  649.   option_argument ("-utabmd", 1, (&option_raw_utabmd));
  650. #ifdef HAS_COMPILER_SUPPORT
  651.   option_argument ("-compiler", 0, (&option_compiler_defaults));
  652.   option_argument ("-edwin", 0, (&option_edwin_defaults));
  653. #endif
  654.   /* The following options are only meaningful to bchscheme. */
  655.   option_argument ("-gc-directory", 1, (&option_gc_directory));
  656.   option_argument ("-gc-drone", 1, (&option_gc_drone));
  657.   option_argument ("-gc-end-position", 1, (&option_raw_gc_end_position));
  658.   option_argument ("-gc-file", 1, (&option_gc_file));
  659.   option_argument ("-gc-keep", 0, (&option_gc_keep));
  660.   option_argument ("-gc-start-position", 1, (&option_raw_gc_start_position));
  661.   option_argument ("-gc-read-overlap", 1, (&option_raw_gc_read_overlap));
  662.   option_argument ("-gc-window-size", 1, (&option_raw_gc_window_size));
  663.   option_argument ("-gc-write-overlap", 1, (&option_raw_gc_write_overlap));
  664.   option_argument ("-gcfile", 1, (&option_raw_gc_file)); /* Obsolete */
  665.   parse_options (argc, argv);
  666. }
  667.  
  668. static CONST char *
  669. DEFUN (standard_string_option, (option, variable, defval),
  670.        CONST char * option AND
  671.        CONST char * variable AND
  672.        CONST char * defval)
  673. {
  674.   if (option != 0)
  675.     return (option);
  676.   {
  677.     CONST char * t = (getenv (variable));
  678.     return ((t != 0) ? t : defval);
  679.   }
  680. }
  681.  
  682. static long
  683. DEFUN (non_negative_numeric_option, (option, optval, variable, defval),
  684.        CONST char * option AND
  685.        CONST char * optval AND
  686.        CONST char * variable AND
  687.        long defval)
  688. {
  689.   if (optval != 0)
  690.     {
  691.       long n = (strtol (optval, ((char **) NULL), 0));
  692.       if (n < 0)
  693.     {
  694.       fprintf (stderr, "%s: illegal argument %s for option %s.\n",
  695.            scheme_program_name, optval, option);
  696.       termination_init_error ();
  697.     }
  698.       return (n);
  699.     }
  700.   {
  701.     CONST char * t = (getenv (variable));
  702.     if (t != 0)
  703.       {
  704.     long n = (strtol (t, ((char **) NULL), 0));
  705.     if (n < 0)
  706.       {
  707.         fprintf (stderr, "%s: illegal value %s for variable %s.\n",
  708.              scheme_program_name, t, variable);
  709.         termination_init_error ();
  710.       }
  711.     return (n);
  712.       }
  713.   }
  714.   return (defval);
  715. }
  716.  
  717. static unsigned int
  718. DEFUN (standard_numeric_option, (option, optval, variable, defval),
  719.        CONST char * option AND
  720.        CONST char * optval AND
  721.        CONST char * variable AND
  722.        unsigned int defval)
  723. {
  724.   if (optval != 0)
  725.     {
  726.       int n = (atoi (optval));
  727.       if (n <= 0)
  728.     {
  729.       fprintf (stderr, "%s: illegal argument %s for option %s.\n",
  730.            scheme_program_name, optval, option);
  731.       termination_init_error ();
  732.     }
  733.       return (n);
  734.     }
  735.   {
  736.     CONST char * t = (getenv (variable));
  737.     if (t != 0)
  738.       {
  739.     int n = (atoi (t));
  740.     if (n <= 0)
  741.       {
  742.         fprintf (stderr, "%s: illegal value %s for variable %s.\n",
  743.              scheme_program_name, t, variable);
  744.         termination_init_error ();
  745.       }
  746.     return (n);
  747.       }
  748.   }
  749.   return (defval);
  750. }
  751.  
  752. static CONST char *
  753. DEFUN_VOID (get_wd)
  754. {
  755.   CONST char * wd = (OS_working_dir_pathname ());
  756.   unsigned int len = (strlen (wd));
  757.   if ((wd [len - 1]) == SUB_DIRECTORY_DELIMITER)
  758.     len -= 1;
  759.   {
  760.     char * result = (xmalloc (len + 1));
  761.     char * scan_result = result;
  762.     CONST char * scan_wd = wd;
  763.     CONST char * end_wd = (scan_wd + len);
  764.     while (scan_wd < end_wd)
  765.       (*scan_result++) = (*scan_wd++);
  766.     (*scan_result) = '\0';
  767.     return (result);
  768.   }
  769. }
  770.  
  771. static CONST char **
  772. DEFUN (parse_path_string, (path), CONST char * path)
  773. {
  774.   CONST char * start = path;
  775.   /* It is important that this get_wd be called here to make sure that
  776.      the the unix getcwd is called now, before it allocates heap space
  777.      This is because getcwd forks off a new process and we want to do
  778.      that before the scheme process gets too big
  779.   */
  780.   CONST char * wd = (get_wd ());
  781.   unsigned int lwd = (strlen (wd));
  782.   while (1)
  783.     {
  784.       CONST char * scan = start;
  785.       CONST char * end;
  786.       while (1)
  787.     {
  788.       int c = (*scan++);
  789.       if ((c == '\0') || (c == PATH_DELIMITER))
  790.         {
  791.           end = (scan - 1);
  792.           break;
  793.         }
  794.     }
  795.       if ((start < end) && ((* (end - 1)) == SUB_DIRECTORY_DELIMITER))
  796.     end -= 1;
  797.       if (end == start)
  798.     obstack_ptr_grow ((&scratch_obstack), (string_copy (wd)));
  799.       else
  800.     {
  801.       int absolute = (FILE_ABSOLUTE (start));
  802.       {
  803.         char * element =
  804.           (xmalloc ((absolute ? 0 : (lwd + 1)) + (end - start) + 1));
  805.         char * scan_element = element;
  806.         if (!absolute)
  807.           {
  808.         CONST char * s = wd;
  809.         CONST char * e = (wd + lwd);
  810.         while (s < e)
  811.           (*scan_element++) = (*s++);
  812.         (*scan_element++) = SUB_DIRECTORY_DELIMITER;
  813.           }
  814.         {
  815.           CONST char * s = start;
  816.           while (s < end)
  817.         (*scan_element++) = (*s++);
  818.         }
  819.         (*scan_element) = '\0';
  820.         obstack_ptr_grow ((&scratch_obstack), element);
  821.       }
  822.     }
  823.       if ((* (scan - 1)) == '\0')
  824.     break;
  825.       start = scan;
  826.     }
  827.   obstack_ptr_grow ((&scratch_obstack), 0);
  828.   if (wd != 0)
  829.     xfree (wd);
  830.   {
  831.     unsigned int n_bytes = (obstack_object_size (&scratch_obstack));
  832.     CONST char ** elements = (obstack_finish (&scratch_obstack));
  833.     CONST char ** scan = elements;
  834.     CONST char ** end = (scan + (n_bytes / (sizeof (char *))));
  835.     CONST char ** result = (xmalloc (n_bytes));
  836.     CONST char ** scan_result = result;
  837.     while (scan < end)
  838.       (*scan_result++) = (*scan++);
  839.     obstack_free ((&scratch_obstack), elements);
  840.     return (result);
  841.   }
  842. }
  843.  
  844. static void
  845. DEFUN (free_parsed_path, (path), CONST char ** path)
  846. {
  847.   CONST char ** scan = path;
  848.   while (1)
  849.     {
  850.       CONST char * element = (*scan++);
  851.       if (element == 0)
  852.     break;
  853.       xfree (element);
  854.     }
  855.   xfree (path);
  856. }
  857.  
  858. CONST char *
  859. DEFUN (search_for_library_file, (filename), CONST char * filename)
  860. {
  861.   unsigned int flen = (strlen (filename));
  862.   CONST char ** scan_path = option_library_path;
  863.   while (1)
  864.     {
  865.       CONST char * directory = (*scan_path++);
  866.       unsigned int dlen;
  867.       CONST char * fullname;
  868.       if (directory == 0)
  869.     return ((char *) NULL);
  870.       dlen = (strlen (directory));
  871.       if (dlen > 0)
  872.     {
  873.       obstack_grow ((&scratch_obstack), directory, dlen);
  874.       obstack_1grow ((&scratch_obstack), SUB_DIRECTORY_DELIMITER);
  875.     }
  876.       obstack_grow ((&scratch_obstack), filename, flen);
  877.       obstack_1grow ((&scratch_obstack), '\0');
  878.       fullname = (obstack_finish (&scratch_obstack));
  879.       if (FILE_READABLE (fullname))
  880.     {
  881.       CONST char * result = (string_copy (fullname));
  882.       obstack_free ((&scratch_obstack), ((char *) fullname));
  883.       return (result);
  884.     }
  885.       obstack_free ((&scratch_obstack), ((char *) fullname));
  886.     }
  887. }
  888.  
  889. CONST char *
  890. DEFUN (search_path_for_file, (option, filename, default_p, fail_p),
  891.        CONST char * option AND
  892.        CONST char * filename AND
  893.        int default_p AND
  894.        int fail_p)
  895. {
  896.   CONST char * result;
  897.  
  898.   if ((result = (search_for_library_file (filename))) != ((char *) NULL))
  899.     return (result);
  900.   if (!fail_p)
  901.     return (filename);
  902.   else
  903.   {
  904.     CONST char ** scan_path = option_library_path;
  905.  
  906.     fprintf (stderr, "%s: can't find a readable %s",
  907.          scheme_program_name, (default_p ? "default" : "file"));
  908.     if (option != 0)
  909.       fprintf (stderr, " for option %s", option);
  910.     fprintf (stderr, ".\n");
  911.     fprintf (stderr, "\tsearched for file %s in these directories:\n",
  912.          filename);
  913.     if (!default_p)
  914.       fprintf (stderr, "\t.\n");
  915.     while (1)
  916.     {
  917.       CONST char * element = (*scan_path++);
  918.       if (element == 0)
  919.     break;
  920.       fprintf (stderr, "\t%s\n", element);
  921.     }
  922.     termination_init_error ();
  923.     /*NOTREACHED*/
  924.   }
  925. }
  926.  
  927. static CONST char *
  928. DEFUN (standard_filename_option, (option, optval, variable, defval, fail_p),
  929.        CONST char * option AND
  930.        CONST char * optval AND
  931.        CONST char * variable AND
  932.        CONST char * defval AND
  933.        int fail_p)
  934. {
  935.   if (optval != 0)
  936.     {
  937.       if (FILE_READABLE (optval))
  938.     return (string_copy (optval));
  939.       if (FILE_ABSOLUTE (optval))
  940.     {
  941.       if (fail_p)
  942.         {
  943.           fprintf (stderr, "%s: can't read file %s for option %s.\n",
  944.                scheme_program_name, optval, option);
  945.           termination_init_error ();
  946.         }
  947.       return (string_copy (optval));
  948.     }
  949.       return (search_path_for_file (option, optval, 0, fail_p));
  950.     }
  951.   {
  952.     CONST char * filename = (getenv (variable));
  953.     if (filename == 0)
  954.       filename = defval;
  955.     if (FILE_ABSOLUTE (filename))
  956.       {
  957.     if ((! (FILE_READABLE (filename))) && fail_p)
  958.       {
  959.         fprintf (stderr, "%s: can't read default file %s for option %s.\n",
  960.              scheme_program_name, filename, option);
  961.         termination_init_error ();
  962.       }
  963.     return (string_copy (filename));
  964.       }
  965.     else
  966.       return (search_path_for_file (option, filename, 1, fail_p));
  967.   }
  968. }
  969.  
  970. static void
  971. DEFUN (conflicting_options, (option1, option2),
  972.        CONST char * option1 AND
  973.        CONST char * option2)
  974. {
  975.   fprintf (stderr, "%s: can't specify both options %s and %s.\n",
  976.        scheme_program_name, option1, option2);
  977.   termination_init_error ();
  978. }
  979.  
  980. static void
  981. DEFUN (describe_boolean_option, (name, value),
  982.        CONST char * name AND
  983.        int value)
  984. {
  985.   fprintf (stderr, "  %s: %s\n", name, (value ? "yes" : "no"));
  986. }
  987.  
  988. static void
  989. DEFUN (describe_string_option, (name, value),
  990.        CONST char * name AND
  991.        CONST char * value)
  992. {
  993.   fprintf (stderr, "  %s: %s\n", name, value);
  994. }
  995.  
  996. static void
  997. DEFUN (describe_numeric_option, (name, value),
  998.        CONST char * name AND
  999.        int value)
  1000. {
  1001.   fprintf (stderr, "  %s: %d\n", name, value);
  1002. }
  1003.  
  1004. static void
  1005. DEFUN (describe_size_option, (name, value),
  1006.        CONST char * name AND
  1007.        unsigned int value)
  1008. {
  1009.   fprintf (stderr, "  %s size: %d\n", name, value);
  1010. }
  1011.  
  1012. static void
  1013. DEFUN (describe_path_option, (name, value),
  1014.        CONST char * name AND
  1015.        CONST char ** value)
  1016. {
  1017.   fprintf (stderr, "  %s: ", name);
  1018.   {
  1019.     CONST char ** scan = value;
  1020.     fprintf (stderr, "%s", (*scan++));
  1021.     while (1)
  1022.       {
  1023.     CONST char * element = (*scan++);
  1024.     if (element == 0) break;
  1025.     fprintf (stderr, ":%s", element);
  1026.       }
  1027.   }
  1028.   fprintf (stderr, "\n");
  1029. }
  1030.  
  1031. static void
  1032. DEFUN_VOID (describe_options)
  1033. {
  1034.   fprintf (stderr, "Summary of configuration options:\n");
  1035.   describe_size_option ("heap", option_heap_size);
  1036.   describe_size_option ("constant-space", option_constant_size);
  1037.   describe_size_option ("stack", option_stack_size);
  1038.   describe_path_option ("library path", option_library_path);
  1039.   if (option_fasl_file != 0)
  1040.     describe_string_option ("FASL file", option_fasl_file);
  1041.   else
  1042.     describe_string_option ("band", option_band_file);
  1043.   describe_string_option ("microcode tables", option_utabmd_file);
  1044.   {
  1045.     /* These are only relevant to bchscheme. */
  1046.     if (option_gc_directory != DEFAULT_GC_DIRECTORY)
  1047.       describe_string_option ("GC directory", option_gc_directory);
  1048.     if (option_gc_drone != DEFAULT_GC_DRONE)
  1049.       describe_string_option ("GC drone program", option_gc_drone);
  1050.     if (option_raw_gc_end_position)
  1051.       describe_numeric_option ("GC end position", option_gc_end_position);
  1052.     if (option_gc_file != DEFAULT_GC_FILE)
  1053.       describe_string_option ("GC file", option_gc_file);
  1054.     if (option_raw_gc_read_overlap)
  1055.       describe_numeric_option ("GC read overlap", option_gc_read_overlap);
  1056.     if (option_raw_gc_start_position)
  1057.       describe_numeric_option ("GC start position", option_gc_start_position);
  1058.     if (option_raw_gc_window_size)
  1059.       describe_size_option ("GC window size", option_gc_window_size);
  1060.     if (option_raw_gc_write_overlap)
  1061.       describe_numeric_option ("GC write overlap", option_gc_write_overlap);
  1062.     if (option_gc_keep)
  1063.       describe_boolean_option ("keep GC file", option_gc_keep);
  1064.   }
  1065.   describe_boolean_option ("emacs subprocess", option_emacs_subprocess);
  1066.   describe_boolean_option ("force interactive", option_force_interactive);
  1067.   describe_boolean_option ("disable core dump", option_disable_core_dump);
  1068.   if (option_unused_argc == 0)
  1069.     fprintf (stderr, "  no unused arguments\n");
  1070.   else
  1071.     {
  1072.       CONST char ** scan = option_unused_argv;
  1073.       CONST char ** end = (scan + option_unused_argc);
  1074.       fprintf (stderr, "  unused arguments:");
  1075.       while (scan < end)
  1076.     fprintf (stderr, " %s", (*scan++));
  1077.       fprintf (stderr, "\n");
  1078.     }
  1079.   fflush (stderr);
  1080. }
  1081.  
  1082. void
  1083. DEFUN (read_command_line_options, (argc, argv),
  1084.        int argc AND
  1085.        CONST char ** argv)
  1086. {
  1087.   parse_standard_options (argc, argv);
  1088.   if (option_library_path != 0)
  1089.     free_parsed_path (option_library_path);
  1090.   option_library_path =
  1091.     (parse_path_string
  1092.      (standard_string_option (option_raw_library,
  1093.                   LIBRARY_PATH_VARIABLE,
  1094.                   DEFAULT_LIBRARY_PATH)));
  1095.   {
  1096.     CONST char * band_variable = BAND_VARIABLE;
  1097.     CONST char * default_band = DEFAULT_BAND;
  1098.     option_band_specified = 0;
  1099.     if (option_band_file != 0)
  1100.       xfree (option_band_file);
  1101. #ifdef HAS_COMPILER_SUPPORT
  1102.     if (option_compiler_defaults)
  1103.       {
  1104.     if (option_edwin_defaults)
  1105.       conflicting_options ("-compiler", "-edwin");
  1106.     option_large_sizes = 1;
  1107.     option_band_specified = 1;
  1108.     band_variable = COMPILER_BAND_VARIABLE;
  1109.     default_band = COMPILER_DEFAULT_BAND;
  1110.       }
  1111.     else if (option_edwin_defaults)
  1112.       {
  1113.     option_large_sizes = 1;
  1114.     option_band_specified = 1;
  1115.     band_variable = EDWIN_BAND_VARIABLE;
  1116.     default_band = EDWIN_DEFAULT_BAND;
  1117.       }
  1118. #endif
  1119.     if (option_fasl_file != 0)
  1120.       {
  1121.     if (option_raw_band != 0)
  1122.       conflicting_options ("-fasl", "-band");
  1123.     if (! (FILE_READABLE (option_fasl_file)))
  1124.       {
  1125.         fprintf (stderr, "%s: can't read option file: -fasl %s\n",
  1126.              scheme_program_name, option_fasl_file);
  1127.         termination_init_error ();
  1128.       }
  1129.     option_large_sizes = 1;
  1130.     option_band_specified = 1;
  1131.     option_band_file = 0;
  1132.       }
  1133.     else
  1134.       {
  1135.     if (option_raw_band != 0)
  1136.       option_band_specified = 1;
  1137.     option_band_file =
  1138.       (standard_filename_option ("-band",
  1139.                      option_raw_band,
  1140.                      band_variable,
  1141.                      default_band,
  1142.                      1));
  1143.       }
  1144.   }
  1145.   if (option_large_sizes)
  1146.     {
  1147.       option_heap_size =
  1148.     (standard_numeric_option ("-heap",
  1149.                   option_raw_heap,
  1150.                   LARGE_HEAP_VARIABLE,
  1151.                   DEFAULT_LARGE_HEAP));
  1152.       option_constant_size =
  1153.     (standard_numeric_option ("-constant",
  1154.                   option_raw_constant,
  1155.                   LARGE_CONSTANT_VARIABLE,
  1156.                   (option_edwin_defaults
  1157.                    ? DEFAULT_EDWIN_CONSTANT
  1158.                    : DEFAULT_LARGE_CONSTANT)));
  1159.  
  1160.       option_stack_size =
  1161.     (standard_numeric_option ("-stack",
  1162.                   option_raw_stack,
  1163.                   LARGE_STACK_VARIABLE,
  1164.                   DEFAULT_LARGE_STACK));
  1165.     }
  1166.   else
  1167.     {
  1168.       option_heap_size =
  1169.     (standard_numeric_option ("-heap",
  1170.                   option_raw_heap,
  1171.                   SMALL_HEAP_VARIABLE,
  1172.                   DEFAULT_SMALL_HEAP));
  1173.       option_constant_size =
  1174.     (standard_numeric_option ("-constant",
  1175.                   option_raw_constant,
  1176.                   SMALL_CONSTANT_VARIABLE,
  1177.                   DEFAULT_SMALL_CONSTANT));
  1178.       option_stack_size =
  1179.     (standard_numeric_option ("-stack",
  1180.                   option_raw_stack,
  1181.                   SMALL_STACK_VARIABLE,
  1182.                   DEFAULT_SMALL_STACK));
  1183.     }
  1184.   if (option_utabmd_file != 0)
  1185.     xfree (option_utabmd_file);
  1186.   if (option_raw_utabmd != 0)
  1187.     {
  1188.       if (option_raw_utab != 0)
  1189.     conflicting_options ("-utabmd", "-utab");
  1190.       option_utabmd_file =
  1191.     (standard_filename_option ("-utabmd",
  1192.                    option_raw_utabmd,
  1193.                    UTABMD_FILE_VARIABLE,
  1194.                    DEFAULT_UTABMD_FILE,
  1195.                    (option_fasl_file != 0)));
  1196.     }
  1197.   else
  1198.     option_utabmd_file =
  1199.       (standard_filename_option ("-utab",
  1200.                  option_raw_utab,
  1201.                  UTABMD_FILE_VARIABLE,
  1202.                  DEFAULT_UTABMD_FILE,
  1203.                  (option_fasl_file != 0)));
  1204.  
  1205.   /* These are only meaningful for bchscheme. */
  1206.  
  1207.   if (option_raw_gc_file != ((char *) 0))
  1208.   {
  1209.     if (option_gc_file != ((char *) 0))
  1210.       conflicting_options ("-gcfile", "-gc-file");
  1211.     else
  1212.       option_gc_file = option_raw_gc_file;
  1213.   }
  1214.  
  1215.   option_gc_directory =
  1216.     (standard_string_option (option_gc_directory,
  1217.                  GC_DIRECTORY_VARIABLE,
  1218.                  DEFAULT_GC_DIRECTORY));
  1219.  
  1220.   option_gc_drone =
  1221.     (standard_filename_option ("-gc-drone",
  1222.                    option_gc_drone,
  1223.                    GC_DRONE_VARIABLE,
  1224.                    DEFAULT_GC_DRONE,
  1225.                    0));
  1226.  
  1227.   option_gc_end_position =
  1228.     (non_negative_numeric_option ("-gc-end-position",
  1229.                   option_raw_gc_end_position,
  1230.                   GC_END_POSITION_VARIABLE,
  1231.                   DEFAULT_GC_END_POSITION));
  1232.  
  1233.   option_gc_file =
  1234.     (standard_string_option (option_gc_file,
  1235.                  GC_FILE_VARIABLE,
  1236.                  DEFAULT_GC_FILE));
  1237.  
  1238.   option_gc_read_overlap =
  1239.     ((int)
  1240.      (non_negative_numeric_option ("-gc-read-overlap",
  1241.                    option_raw_gc_read_overlap,
  1242.                    GC_READ_OVERLAP_VARIABLE,
  1243.                    DEFAULT_GC_READ_OVERLAP)));
  1244.  
  1245.   option_gc_start_position =
  1246.     (non_negative_numeric_option ("-gc-start-position",
  1247.                   option_raw_gc_start_position,
  1248.                   GC_START_POSITION_VARIABLE,
  1249.                   DEFAULT_GC_START_POSITION));
  1250.  
  1251.   option_gc_window_size =
  1252.     (standard_numeric_option ("-gc-window-size",
  1253.                   option_raw_gc_window_size,
  1254.                   GC_WINDOW_SIZE_VARIABLE,
  1255.                   DEFAULT_GC_WINDOW_SIZE));
  1256.  
  1257.   option_gc_write_overlap =
  1258.     ((int)
  1259.      (non_negative_numeric_option ("-gc-write-overlap",
  1260.                    option_raw_gc_write_overlap,
  1261.                    GC_WRITE_OVERLAP_VARIABLE,
  1262.                    DEFAULT_GC_WRITE_OVERLAP)));
  1263.  
  1264.   if (option_summary)
  1265.     describe_options ();
  1266. }
  1267.